#include <iostream>
#include <vector>
//c++11引入的新的计时方法
#include <chrono>  
#include "Sort.h"
using namespace std;
using namespace chrono;

int main(int argc, char const *argv[])
{
	Sort *sort = new Sort();

	auto start = system_clock::now();
	//sort->BubbleSort();
	//sort->OptimizeBubbleSort();
	//sort->InsertSort();

	//sort->InsertSort();

	cout<<"插入排序后:"<<endl;
	//DisplayArray(array_copy);
	//sort->InsertSort();

	auto end   = system_clock::now();
	auto duration = duration_cast<microseconds>(end - start);

	cout<<"花费了" 
     	<<double(duration.count()) * microseconds::period::num / microseconds::period::den 
     	<<"秒"<<endl;
	

	start = system_clock::now();

	//sort->ShellSort();

	//cout<<"希尔排序后:"<<endl;
	//DisplayArray(array_copy);
	cout<<"堆排序后:"<<endl;
	sort->HeapSort();
	//sort->QuickSort();
	//sort->MergeSort();

	end   = system_clock::now();
	duration = duration_cast<microseconds>(end - start);

	cout<<"花费了" 
     	<<double(duration.count()) * microseconds::period::num / microseconds::period::den 
     	<<"秒"<<endl;
	//sort->MergeSort();
	//sort->QuickSort();
	//sort->HeapSort();
	return 0;
}